<%@page contentType="text/html;charset=GB2312"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@include file="opendata.jsp"%>
<%@include file="check.jsp"%>
<%
 int questionid;
 int isvisable;
 questionid = Integer.parseInt(request.getParameter("questionid"));
 out.print(questionid);
 sql = "SELECT IsVisable from Questions where QuestionID ="+questionid;
 rs = smt.executeQuery(sql);
// rs.beforeFirst();
 if(rs.next())
  {
   isvisable = rs.getInt(1);
   if(isvisable==1)
   {
     sql = "update Questions set IsVisable = 0 ,IsOpen = 0 where QuestionID = "+questionid;
     smt.executeUpdate(sql);
     response.sendRedirect("mainform.jsp");
   }
   else if(isvisable==0)
   {
     sql = "update Questions set IsVisable = 1 ,IsOpen = 0 where QuestionID = "+questionid;
     smt.executeUpdate(sql);
     response.sendRedirect("mainform.jsp");;
   }

  }
%>
<html>
<head>
<title>
isvisable
</title>
</head>

</html>
